import request from '@/utils/request.js'
import { useTokenStore } from '@/stores/token.js'

//提供调用设备分页查询接口的函数
export const devicePageQueryService = (params)=>{
    return request.get('/admin/device/page',{params: params});
}

//修改设备信息
export const deviceInfoUpdateService = (userInfoData)=>{
    return request.put('/admin/device',userInfoData)
}

 //删除指定id的设备信息
export const deviceDeleteService = (id)=>{
    return request.delete('/admin/device/delete/' + id)
 }

  //根据id获取设备信息
export const deviceInfoGetService = (id)=>{
    return request.get('/admin/device/' + id)
}

  //根据id获取设备名称
  export const deviceNameGetService = (id)=>{
    return request.get('/admin/device/name/' + id)
}

export const deviceRegisterService = (registerData)=>{
    return request.post('/admin/device/add', registerData)
}

export const deviceStatusGetService = (deviceId)=>{
    return request.get('/admin/device/'+ deviceId + '/status')
}

export const deviceFilterStatusGetService = (deviceId)=>{
    return request.get('/admin/device/'+ deviceId + '/filter')
}

export const deviceStatusRecordGetService = (params)=>{
    return request.get('/admin/device/statistic', {params: params})
}

export const deviceStatisticAllService = ()=>{
    return request.get('/admin/device/statisticAll')
}